<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>使用CSS实现折叠面板</title>
    <style>
    label {
        display: block;
        width: 800px;
        height: 30px;
        line-height: 30px;
        color: #333;
        background-color: #f5f5f5;
        text-align: center;
        border: 1px solid #ddd;
        border-radius: 3px;
    }
    input[type="radio"] {
        position: absolute;
        left: -1000px;
    }
    .fold {
        height: 0px;
        overflow: hidden;
        visibility: hidden;
        transition: height 0.3s ease-in-out;
        width: 800px;
        border: 1px solid #ddd;
        border-radius: 3px;
        margin-bottom: 5px;
        border-top: none;
    }
    #radio1:checked~.fold1 {
        height: 150px;
        visibility: visible;
    }
    #radio2:checked~.fold2 {
        height: 150px;
        visibility: visible;
    }
    #radio3:checked~.fold3 {
        height: 150px;
        visibility: visible;
    }        
    </style>
</head>
<body>
    <div class="container">
        <label for="radio1" id="label1">折叠面板一</label>
        <input type="radio" id="radio1" name="fold">
        <div class="fold fold1">
            <p>Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.</p>
        </div>

        <label for="radio2" id="label2">折叠面板二</label>
        <input type="radio" id="radio2" name="fold">
        <div class="fold fold2">
            <p>Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.</p>
        </div>

        <label for="radio3" id="label3">折叠面板三</label>
        <input type="radio" id="radio3" name="fold">
        <div class="fold fold3">
            <p>Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.</p>
        </div>
    </div>
</body>
</html>